<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Time.Calendar.MonthDay</span><span>
</span><span id="line-2"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-3"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYear"><span class="hs-identifier">monthAndDayToDayOfYear</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYearValid"><span class="hs-identifier">monthAndDayToDayOfYearValid</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#dayOfYearToMonthAndDay"><span class="hs-identifier">dayOfYearToMonthAndDay</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthLength"><span class="hs-identifier">monthLength</span></a></span><span>
</span><span id="line-4"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Private.html"><span class="hs-identifier">Data.Time.Calendar.Private</span></a></span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-comment">-- | Convert month and day in the Gregorian or Julian calendars to day of year.</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- First arg is leap year flag.</span><span>
</span><span id="line-10"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYear"><span class="hs-identifier hs-type">monthAndDayToDayOfYear</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-11"></span><span id="monthAndDayToDayOfYear"><span class="annot"><span class="annottext">monthAndDayToDayOfYear :: Bool -&gt; Int -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYear"><span class="hs-identifier hs-var hs-var">monthAndDayToDayOfYear</span></a></span></span><span> </span><span id="local-6989586621679068345"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068345"><span class="hs-identifier hs-var">isLeap</span></a></span></span><span> </span><span id="local-6989586621679068344"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068344"><span class="hs-identifier hs-var">month</span></a></span></span><span> </span><span id="local-6989586621679068343"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068343"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">367</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068340"><span class="hs-identifier hs-var">month''</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">362</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068338"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068337"><span class="hs-identifier hs-var">day'</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-12"></span><span>    </span><span id="local-6989586621679068333"><span class="annot"><span class="annottext">month' :: Int
</span><a href="#local-6989586621679068333"><span class="hs-identifier hs-var hs-var">month'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; t
</span><a href="Data.Time.Calendar.Private.html#clip"><span class="hs-identifier hs-var">clip</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068344"><span class="hs-identifier hs-var">month</span></a></span><span>
</span><span id="line-13"></span><span>    </span><span id="local-6989586621679068337"><span class="annot"><span class="annottext">day' :: Int
</span><a href="#local-6989586621679068337"><span class="hs-identifier hs-var hs-var">day'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; t
</span><a href="Data.Time.Calendar.Private.html#clip"><span class="hs-identifier hs-var">clip</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength%27"><span class="hs-identifier hs-var">monthLength'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068345"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068333"><span class="hs-identifier hs-var">month'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068343"><span class="hs-identifier hs-var">day</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span>    </span><span id="local-6989586621679068340"><span class="annot"><span class="annottext">month'' :: Int
</span><a href="#local-6989586621679068340"><span class="hs-identifier hs-var hs-var">month''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068333"><span class="hs-identifier hs-var">month'</span></a></span><span>
</span><span id="line-15"></span><span>    </span><span id="local-6989586621679068338"><span class="annot"><span class="annottext">k :: Int
</span><a href="#local-6989586621679068338"><span class="hs-identifier hs-var hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068333"><span class="hs-identifier hs-var">month'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068345"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-comment">-- | Convert month and day in the Gregorian or Julian calendars to day of year.</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- First arg is leap year flag.</span><span>
</span><span id="line-19"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYearValid"><span class="hs-identifier hs-type">monthAndDayToDayOfYearValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-20"></span><span id="monthAndDayToDayOfYearValid"><span class="annot"><span class="annottext">monthAndDayToDayOfYearValid :: Bool -&gt; Int -&gt; Int -&gt; Maybe Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYearValid"><span class="hs-identifier hs-var hs-var">monthAndDayToDayOfYearValid</span></a></span></span><span> </span><span id="local-6989586621679068316"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068316"><span class="hs-identifier hs-var">isLeap</span></a></span></span><span> </span><span id="local-6989586621679068315"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068315"><span class="hs-identifier hs-var">month</span></a></span></span><span> </span><span id="local-6989586621679068314"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068314"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-21"></span><span>    </span><span id="local-6989586621679068313"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068313"><span class="hs-identifier hs-var">month'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Maybe Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; Maybe t
</span><a href="Data.Time.Calendar.Private.html#clipValid"><span class="hs-identifier hs-var">clipValid</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068315"><span class="hs-identifier hs-var">month</span></a></span><span>
</span><span id="line-22"></span><span>    </span><span id="local-6989586621679068311"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068311"><span class="hs-identifier hs-var">day'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Maybe Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; Maybe t
</span><a href="Data.Time.Calendar.Private.html#clipValid"><span class="hs-identifier hs-var">clipValid</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength%27"><span class="hs-identifier hs-var">monthLength'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068316"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068313"><span class="hs-identifier hs-var">month'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068314"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-24"></span><span>        </span><span id="local-6989586621679068308"><span class="annot"><span class="annottext">day'' :: Int
</span><a href="#local-6989586621679068308"><span class="hs-identifier hs-var hs-var">day''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068311"><span class="hs-identifier hs-var">day'</span></a></span><span>
</span><span id="line-25"></span><span>        </span><span id="local-6989586621679068305"><span class="annot"><span class="annottext">month'' :: Int
</span><a href="#local-6989586621679068305"><span class="hs-identifier hs-var hs-var">month''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068313"><span class="hs-identifier hs-var">month'</span></a></span><span>
</span><span id="line-26"></span><span>        </span><span id="local-6989586621679068297"><span class="annot"><span class="annottext">k :: Int
</span><a href="#local-6989586621679068297"><span class="hs-identifier hs-var hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068313"><span class="hs-identifier hs-var">month'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068316"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">367</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068305"><span class="hs-identifier hs-var">month''</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">362</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068297"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068308"><span class="hs-identifier hs-var">day''</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-comment">-- | Convert day of year in the Gregorian or Julian calendars to month and day.</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- First arg is leap year flag.</span><span>
</span><span id="line-31"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#dayOfYearToMonthAndDay"><span class="hs-identifier hs-type">dayOfYearToMonthAndDay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span id="dayOfYearToMonthAndDay"><span class="annot"><span class="annottext">dayOfYearToMonthAndDay :: Bool -&gt; Int -&gt; (Int, Int)
</span><a href="Data.Time.Calendar.MonthDay.html#dayOfYearToMonthAndDay"><span class="hs-identifier hs-var hs-var">dayOfYearToMonthAndDay</span></a></span></span><span> </span><span id="local-6989586621679068296"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068296"><span class="hs-identifier hs-var">isLeap</span></a></span></span><span> </span><span id="local-6989586621679068295"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068295"><span class="hs-identifier hs-var">yd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int -&gt; (Int, Int)
</span><a href="Data.Time.Calendar.MonthDay.html#findMonthDay"><span class="hs-identifier hs-var">findMonthDay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [Int]
</span><a href="Data.Time.Calendar.MonthDay.html#monthLengths"><span class="hs-identifier hs-var">monthLengths</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068296"><span class="hs-identifier hs-var">isLeap</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; t
</span><a href="Data.Time.Calendar.Private.html#clip"><span class="hs-identifier hs-var">clip</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068296"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">366</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">365</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068295"><span class="hs-identifier hs-var">yd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#findMonthDay"><span class="hs-identifier hs-type">findMonthDay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span id="findMonthDay"><span class="annot"><span class="annottext">findMonthDay :: [Int] -&gt; Int -&gt; (Int, Int)
</span><a href="Data.Time.Calendar.MonthDay.html#findMonthDay"><span class="hs-identifier hs-var hs-var">findMonthDay</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679068292"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068292"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679068291"><span class="annot"><span class="annottext">[Int]
</span><a href="#local-6989586621679068291"><span class="hs-identifier hs-var">ns</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679068290"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068290"><span class="hs-identifier hs-var">yd</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068290"><span class="hs-identifier hs-var">yd</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068292"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679068288"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068288"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068287"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068287"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068288"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068287"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; Int -&gt; (Int, Int)
</span><a href="Data.Time.Calendar.MonthDay.html#findMonthDay"><span class="hs-identifier hs-var">findMonthDay</span></a></span><span> </span><span class="annot"><span class="annottext">[Int]
</span><a href="#local-6989586621679068291"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068290"><span class="hs-identifier hs-var">yd</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068292"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#findMonthDay"><span class="hs-identifier hs-var">findMonthDay</span></a></span><span> </span><span class="annot"><span class="annottext">[Int]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679068286"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068286"><span class="hs-identifier hs-var">yd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068286"><span class="hs-identifier hs-var">yd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | The length of a given month in the Gregorian or Julian calendars.</span><span>
</span><span id="line-39"></span><span class="hs-comment">-- First arg is leap year flag.</span><span>
</span><span id="line-40"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthLength"><span class="hs-identifier hs-type">monthLength</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-41"></span><span id="monthLength"><span class="annot"><span class="annottext">monthLength :: Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength"><span class="hs-identifier hs-var hs-var">monthLength</span></a></span></span><span> </span><span id="local-6989586621679068285"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068285"><span class="hs-identifier hs-var">isLeap</span></a></span></span><span> </span><span id="local-6989586621679068284"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068284"><span class="hs-identifier hs-var">month'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength%27"><span class="hs-identifier hs-var">monthLength'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068285"><span class="hs-identifier hs-var">isLeap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; t
</span><a href="Data.Time.Calendar.Private.html#clip"><span class="hs-identifier hs-var">clip</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068284"><span class="hs-identifier hs-var">month'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthLength%27"><span class="hs-identifier hs-type">monthLength'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-44"></span><span id="monthLength%27"><span class="annot"><span class="annottext">monthLength' :: Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength%27"><span class="hs-identifier hs-var hs-var">monthLength'</span></a></span></span><span> </span><span id="local-6989586621679068283"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068283"><span class="hs-identifier hs-var">isLeap</span></a></span></span><span> </span><span id="local-6989586621679068282"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068282"><span class="hs-identifier hs-var">month'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [Int]
</span><a href="Data.Time.Calendar.MonthDay.html#monthLengths"><span class="hs-identifier hs-var">monthLengths</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068283"><span class="hs-identifier hs-var">isLeap</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int -&gt; Int
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068282"><span class="hs-identifier hs-var">month'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html#monthLengths"><span class="hs-identifier hs-type">monthLengths</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">]</span><span>
</span><span id="line-47"></span><span id="monthLengths"><span class="annot"><span class="annottext">monthLengths :: Bool -&gt; [Int]
</span><a href="Data.Time.Calendar.MonthDay.html#monthLengths"><span class="hs-identifier hs-var hs-var">monthLengths</span></a></span></span><span> </span><span id="local-6989586621679068280"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068280"><span class="hs-identifier hs-var">isleap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679068280"><span class="hs-identifier hs-var">isleap</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">29</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">28</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">30</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">30</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">30</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">30</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">31</span></span><span class="hs-special">]</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-comment">--J        F                   M  A  M  J  J  A  S  O  N  D</span><span>
</span><span id="line-50"></span></pre></body></html>